
import request from "@/utils/request";
class WithdrawAPI {
  /*     获取提现列表     */
  static getList (params) {
    return request({
      url: "/api/admin/withdrawals",
      method: "GET",
      params
    });
  }
  /*     获取    */
  static get (id) {
    return request({
      url: `/api/admin/withdrawals/${id}`,
      method: "GET",
    });
  }
  /*     批准    */
  static approve (id) {
    return request({
      url: `/api/admin/withdrawals/${id}/approve`,
      method: "POST",
    });
  }
  /*     撤销批准    */
  static revoke (id) {
    return request({
      url: `/api/admin/withdrawals/${id}/revoke`,
      method: "POST",
    });
  }
  /*     代付    */
  static process (id, data) {
    return request({
      url: `/api/admin/withdrawals/${id}/process`,
      method: "POST",
      data
    });
  }
  /*     强制出款    */
  static complete (id) {
    return request({
      url: `/api/admin/withdrawals/${id}/complete`,
      method: "POST",
    });
  }
  /*     拒绝    */
  static reject (id, data) {
    return request({
      url: `/api/admin/withdrawals/${id}/reject`,
      method: "POST",
      data
    });
  }
  /*     导出export    */
  static exports (id, data) {
    return request({
      url: `/api/admin/withdrawals/export`,
      method: "POST",
      data
    });
  }
  /**
   * 驳回
   *
   * @param id
   * @param data
   * @returns {*}
   */

  /*
  |--------------------------------------------------------------------------
  | 提示
  |--------------------------------------------------------------------------
  |
  | 驳回提现申请，确认操作？
  |
  | 确认 取消
  */
  static deny (id, data) {
    return request({
      url: `/api/admin/withdrawals/${id}/deny`,
      method: "POST",
      data
    });
  }

  /**
   * 锁定
   *
   * @param id
   * @param data
   * @returns {*}
   */
  static lock (id, data) {
    return request({
      url: `/api/admin/withdrawals/${id}/lock`,
      method: "POST",
      data
    });
  }

  /**
   * 解锁
   *
   * @param id
   * @param data
   * @returns {*}
   */
  static unlock (id, data) {
    return request({
      url: `/api/admin/withdrawals/${id}/unlock`,
      method: "POST",
      data
    });
  }

  /**
   * 代付
   *
   * 说明：只有锁定状态，才可以操作代付
   *
   * @param id
   * @param data
   * @returns {*}
   */
  /*
  |--------------------------------------------------------------------------
  | 提示
  |--------------------------------------------------------------------------
  |
  | 批准提现申请，确认出款？
  |
  | 确认 取消
  */
  static send (id, data) {
    return request({
      url: `/api/admin/withdrawals/${id}/send`,
      method: "POST",
      data
    });
  }

  // force fill to successful
  // 强制出款
  static approve (id, data) {
    return request({
      url: `/api/admin/withdrawals/${id}/approve`,
      method: "POST",
      data
    });
  }


}
export default WithdrawAPI;